using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       GCRoleInfoSender.cs
*@brief      send message GCRoleInfo
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/26
*/

//send message GCRoleInfo
public class msgGCRoleInfo
{
    public const int MessageId = (int)GameSyncTypes.MessageType.GCRoleInfo;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public gamesync.RoleInfo MsgContent = new gamesync.RoleInfo();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgGCRoleInfo"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='detail'>
	/// Detail.
	/// </param>
	public msgGCRoleInfo(int session_id, int gate_code, objectinfo.RoleInfoDetail detail)
	{
		SessionId = session_id;
		MsgContent.Role = detail;
		MsgContent.GateCode = gate_code;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of GCRoleInfo</param>
    public static void ProcessMessage(msgGCRoleInfo msg)
    {
        //TODO
        //Main Message:  msgGameSync
		msgGameSync mainMsg = new msgGameSync(msg.SessionId, msg.MsgContent.GateCode, msgGCRoleInfo.MessageId, ProtoNet<gamesync.RoleInfo>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
